#include "vector.h"
#include "matrix.h"
#include <iostream>


void test_Vector();
void test_Matrix();

int main(int argc, char* argv[])
{
    using namespace std;
    using namespace linalg;

    test_Vector();
    test_Matrix();

    return 0;
}

void test_Vector()
{
    using namespace std;
    using namespace linalg;

    // Test Vector
    Vector<int> v1(5);

    v1.fill(3);

    Vector<int> v2 = v1 + v1;

    Vector<int> v3 = v1 * v2;

    Vector<double> v4 = {1.0, 2.0, 3.0, 4.0};
    Vector<double> v5 = v4 * 2.0;
    Vector<double> v6 = v5 / 3.0;
    Vector<double> v7 = 1.0 / v5;

    cout << "v1: " << v1 << endl;
    cout << "v2: " << v2 << endl;
    cout << "v3: " << v3 << endl;
    cout << "v4: " << v4 << endl;
    cout << "v5: " << v5 << endl;
    cout << "v6: " << v6 << endl;
    cout << "v7: " << v7 << endl;

    cout << "sum(v3): " << sum(v3) << endl;
    cout << "dot(v1, v2): " << dot(v1, v2) << endl;

}

void test_Matrix()
{
    using namespace std;
    using namespace linalg;

    // Test Matrix
    Matrix<int> m1(3, 3);

    m1.fill(3);

    cout << "m1: " << m1 << endl;

    Matrix<int> m2 = m1 + m1;

    /*
    cout << "m2.nrow: " << m2.rows() << endl;
    cout << "m2.ncol: " << m2.cols() << endl;
    */

    cout << "m2: " << m2 << endl;
    
}